package com.example.mvp.delegate

import android.text.TextUtils
import cn.jzvd.JZVideoPlayer
import cn.jzvd.JZVideoPlayerStandard
import com.example.baselibrary.R


/**
 * 视频播放
 * @author  chaohaipeng  on 2018/7/20.
 */
class VideoPlayerDelegate:BaseAppDelegate(){
    override fun initWidget() {
    }

    override fun initLayoutRes(): Int {
        return R.layout.activity_video_palyer
    }

    /**
     * 视频播放
     */
    fun playerVideo(videoPath:String?){
         val jz_avp_video_player= getView<JZVideoPlayerStandard>(R.id.jz_avp_video_player)
        if (!TextUtils.isEmpty(videoPath)){
            jz_avp_video_player?.setUp(videoPath, JZVideoPlayer.SCREEN_WINDOW_NORMAL, if (TextUtils.isEmpty(" ")) " " + "" else " ")
            jz_avp_video_player?.startVideo()
        }
    }



}